package blog.service.client.impl;



import blog.dao.client.BlogClientMapper;
import blog.entity.Blog;
import blog.service.client.BlogClientService;
import blog.vo.back.ByTagUuidGetNoneHighlightBlogInfoVO;
import blog.vo.client.BlogVO;
import blog.vo.client.ByBlogUuidAndHighlightBlogInfoVO;
import blog.vo.common.PaginationVO;
import cn.hutool.core.bean.BeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 　　* @description: TODO
 * 　　* @param
 * 　　* @return
 * 　　* @throws
 * 　　* @author Administrator
 * 　　* @date $ $
 *
 */
@Service
public class BlogClientServiceImpl implements BlogClientService {
    @Autowired
    private BlogClientMapper blogClientMapper;
    @Override
    public List<BlogVO> getNoneHighlightBlog(PaginationVO paginationVO) {
        return blogClientMapper.getNoneHighlightBlog(paginationVO.getPageNum(),paginationVO.getPageSize());
    }

    @Override
    public List<BlogVO> getAllRootHighlightBlogInfo(PaginationVO paginationVO) {
        return blogClientMapper.getAllRootHighlightBlogInfo(paginationVO.getPageNum(),paginationVO.getPageSize());
    }

    @Override
    public List<BlogVO> byTagUuidGetNoneHighlightBlogInfo(ByTagUuidGetNoneHighlightBlogInfoVO byTagUuidGetNoneHighlightBlogInfoVO) {
        return blogClientMapper.byTagUuidGetNoneHighlightBlogInfo(byTagUuidGetNoneHighlightBlogInfoVO);
    }

    @Override
    public BlogVO byBlogUuidAndHighlightBlogInfo(ByBlogUuidAndHighlightBlogInfoVO byBlogUuidAndHighlightBlogInfoVO) {
            Blog blog = BeanUtil.copyProperties(byBlogUuidAndHighlightBlogInfoVO, Blog.class);
            return blogClientMapper.byBlogUuidAndHighlightBlogInfo(blog);
        }
    }


